<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>文墨社区</title>
    <!-- Bootstrap -->
    <link href="css/bootstrap.min.css" type="text/html" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="css/common.css">
    <link rel="stylesheet" type="text/css" href="css/index.css">

    <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
    <script src="js/jquery-3.3.1.js"></script>
    <!-- Include all compiled plugins (below), or include individual files as needed -->

    <script src="js/getParameter.js"></script>
    <script>


        //判断是否登录
        function checkLogin() {
            $.get("user/loginOrNot", {}, function(data) {
                if (data == null) {
                    alert("您尚未登录，请登录！");
                } else {
                    location.href = "person.html";
                }
            });
        }
        $(function () {
            //查询用户名名字
            $.get("user/findOneByCode", {}, function (data) {
                var username = data.username;
                // console.log(data);
                $("#username").html(username);
            });
            //查询用户头像
            $.get("user/findImage",{},function(data){
                var image = document.getElementById("image");
                image.src = data.image;
            });
        });
    </script>
</head>
<body>
<header id="header" style="background-color: #2DABFF; height: 60px">
    <!-- 首页-->
    <div>
        <div class="first_page">
            <a href="index.html">首页</a>
        </div>
    </div>

    <!-- 精选文章  -->
    <div class="goodArticle">
        <a href="article/seekGoodArticle">精选文章</a>
    </div>

    <!-- 文章中心  -->
    <div class="category">
        <a href="article/pageQuery">文章中心</a>
    </div>

    <div id="information">
        <div class="image">
            <img  id="image" src="">
        </div>
        <div id="username" class="username">
<!--           kangkang-->
        </div>
    </div>
    <!-- 管理员登录  -->
    <div class="admin">
        <a href="login.jsp">管理员登录</a>
    </div>

    <!-- 个人中心  -->
    <div id="person" class="person">
        <a href="javascript:void(0);" onclick="checkLogin()">个人中心</a>
    </div>

    <!-- 登录状态  -->
    <div class="login">
        <a href="javascript:location.href='user/exit'; " style="color: #cdd8ed">退出</a>
    </div>
    <!-- 未登录状态  -->
    <div class="login_out" style="width: 150px; ">
        <a href="login.html">登录</a>
        &nbsp;
        &nbsp;
        <a href="register.html">注册</a>
    </div>

</header>



<div>
    <img src="images/login_back3.jpg" style="height: 100%; width: 100%">
</div>

</body>
</html>
